using UnityEngine;
using System.Collections;
using SmartFoxClientAPI;
using SmartFoxClientAPI.Data;
using SmartFoxClientAPI.Util;

public class GameGUI : MonoBehaviour {
	private SmartFoxClient smartFox;
	//private bool shuttingDown = false;

	public enum GameState {
		WAITING_FOR_PLAYERS = 0,
		RUNNING,
		GAME_WON,
		GAME_LOST,
		GAME_TIE,
		GAME_DISRUPTED
	};

	public GUISkin gSkin;
	
	private bool started = false;

	/************
	 * Unity callback methods
	 ************/


	void FixedUpdate() {
		if (!started) return;
		smartFox.ProcessEventQueue();
	}

	void Awake() {
		//Application.runInBackground = true;

		if ( SmartFox.IsInitialized() ) {
			smartFox = SmartFox.Connection;
		} else {
			Application.LoadLevel("login");
			return;
		}
	}
}
